'use strict'

const Sequelize=require('sequelize');
const config = require('../../config');

// 数据库1 实例
exports.perDatebase = function () {
	var sequelize = new Sequelize(config.database1.DATABASE, config.database1.USERNAME, config.database1.PASSWORD, {
	    host: config.database1.HOST,
	    dialect: 'mysql',
	    pool: {
	        max: 5,
	        min: 0,
	        idle: 30000
	    }
	});
  return sequelize;
}

// 数据库2 实例
exports.newDatebase = function () {
	var sequelize = new Sequelize(config.database2.DATABASE, config.database2.USERNAME, config.database2.PASSWORD, {
	    host: config.database2.HOST,
	    dialect: 'mysql',
	    pool: {
	        max: 5,
	        min: 0,
	        idle: 30000
	    }
	});
  return sequelize;
}


